<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link href="css/main.css" rel="stylesheet" type="text/css"/>
<link href="css/mystyle.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript">
	function submitForm(){
		var username = document.getElementById('username').value;
		var password = document.getElementById('password').value;
		
		if (username=="" || password=="") {
			var error = document.getElementById('error');
			error.style.display = 'block';
			return false;
		}
		
		return true;
	}
</script>
<title>User Login</title>
</head>
<body>
	<form action="UserServlet" method="post" onsubmit="return submitForm()">
		Username <input id="username" type="text" name="username"/><br/>
		Password <input id="password" type="password" name="password"><br/>
		<input type="hidden" name="url" value="${param.url}"/>
		<p id="error" class="error">Please input username and password</p>
		<p style="color: red">${requestScope.ERROR}</p>
		<input type="submit" name="action" value="login"/>
	</form>
</body>
</html>